<?
include("/var/www/html/new/com.inc.php");
include("class/SimpleExcel.class.php");
// $sql="SELECT * FROM uu_land LIMIT 1";
$sql="SELECT * FROM uu_area";
$GLOBALS['le']->query($sql);
$area = array();
while($row=$GLOBALS['le']->fetch_assoc()){
	$area[$row['area_id']]= $row['area_name'];	
}
$sql="SELECT l.*,m.dname FROM uu_land l LEFT JOIN pft_member m ON l.apply_did=m.id WHERE l.status<3";
$GLOBALS['le']->query($sql);
$land = array();
while($row=$GLOBALS['le']->fetch_assoc()){
	$land[]= $row;	
}

$Excel = array();
$filename='票付通景区';
$Excel[0]['a']='省';
$Excel[0]['b']='市';
$Excel[0]['c']='景区ID';
$Excel[0]['d']='景区名称';
$Excel[0]['e']='供应商';
$Excel[0]['f']='状态';
$i=1;
foreach($land as $key=>$row){
	$n++;
	$tmp = explode("|",$row['area']);
	$Excel[$n]['a']=$area[$tmp[0]];
	$Excel[$n]['b']=$area[$tmp[1]];
	$Excel[$n]['c']=$row['id'];
	$Excel[$n]['d']=$row['title'];
	$Excel[$n]['e']=$row['dname'];
	if($row['status']==2){
		$Excel[$n]['f']='下架';
	}elseif($row['status']==1){
		$Excel[$n]['f']='在售';
	}else{
		$Excel[$n]['f']='删除';
	}
	
}
$xls = new SimpleExcel('UTF-8', true,'orderList');
$xls->addArray($Excel);
$xls->generateXML($filename);
exit;
?>